// API响应类型
export interface ApiResponse<T> {
  code: number;
  message: string;
  data: T;
}

// 分页数据类型
export interface PageResult<T> {
  records: T[];
  total: number;
  size: number;
  current: number;
  pages: number;
}

// 商品类型
export interface Product {
  id: number;
  name: string;
  description: string;
  price: number;
  stock: number;
  categoryId: number;
  merchantId: number;
  status: number;
  createTime: string;
  updateTime: string;
}

// 促销活动类型
export interface Promotion {
  id: number;
  name: string;
  type: 'discount' | 'percent' | 'flash';
  rules: string;
  startTime: string;
  endTime: string;
  status: number;
  merchantId: number;
  createTime: string;
  updateTime: string;
}

// 商品详情类型
export interface ProductDetail {
  product: Product;
  hasPromotion: boolean;
  promotion?: Promotion;
  promotionPrice?: number;
  stock: number;
}

// 分类类型
export interface Category {
  id: number;
  name: string;
  sort: number;
  createTime: string;
  updateTime: string;
}

// 地址类型
export interface Address {
  id: number;
  userId: number;
  name: string;
  phone: string;
  province: string;
  city: string;
  district: string;
  detail: string;
  isDefault: number;
  createTime: string;
  updateTime: string;
}

// 订单类型
export interface Order {
  id: number;
  orderNo: string;
  userId: number;
  totalAmount: number;
  payAmount: number;
  payType: number;
  status: number;
  addressId: number;
  deliveryCompany: string;
  deliveryNo: string;
  autoConfirmDays: number;
  receiveTime: string;
  note: string;
  confirmStatus: number;
  deleteStatus: number;
  paymentTime: string;
  deliveryTime: string;
  createTime: string;
  updateTime: string;
}

// 订单项类型
export interface OrderItem {
  id: number;
  orderId: number;
  orderNo: string;
  productId: number;
  productName: string;
  productPrice: number;
  quantity: number;
  promotionId: number;
  promotionName: string;
  realAmount: number;
  createTime: string;
  updateTime: string;
}

// 用户类型
export interface User {
  id: number;
  username: string;
  nickname: string;
  phone: string;
  status: number;
  createTime: string;
  updateTime: string;
}

// 商家类型
export interface Merchant {
  id: number;
  username: string;
  name: string;
  phone: string;
  status: number;
  createTime: string;
  updateTime: string;
}

// 评价类型
export interface Review {
  id: number;
  userId: number;
  productId: number;
  orderNo: string;
  star: number;
  content: string;
  createTime: string;
  updateTime: string;
}

// 统计数据类型
export interface StatisticsData {
  totalSales: number;
  totalOrders: number;
  totalProducts: number;
  totalUsers: number;
}
